::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #B2B8C5;
  border: 3px solid transparent;
  border-radius: 7px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgb(0 0 0 / 0.5);
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-track:hover {
  background-color: #f8fafc;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: #333;
  background-color: $g-app-bg;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;

  &.body-hidden {
    overflow: hidden;
  }
}

* {
  box-sizing: inherit;
}
// 右侧内容区针对fixed元素，有横向铺满的需求，可在fixed元素上设置 [data-fixed-calc-width]
[data-fixed-calc-width] {
  position: fixed;
  right: 0;
  left: 50%;
}

[data-layout="adaption"] {
  [data-fixed-calc-width] {
    width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
  }

  &[data-sidebar-no-collapse] {
    [data-fixed-calc-width] {
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(calc($g-sub-sidebar-width / 2));
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(100% - #{$g-sub-sidebar-width});
        transform: translateX(-50%) translateX(calc($g-sub-sidebar-width / 2));
      }
    }
  }

  &[data-sidebar-collapse] {
    [data-fixed-calc-width] {
      width: calc(100% - #{$g-main-sidebar-width} - 64px);
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(32px);
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(100% - 64px);
        transform: translateX(-50%) translateX(32px);
      }
    }
  }
}

[data-layout="adaption-min-width"] {
  [data-fixed-calc-width] {
    width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
  }

  &[data-sidebar-no-collapse] {
    [data-fixed-calc-width] {
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(calc($g-sub-sidebar-width / 2));
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(100% - #{$g-sub-sidebar-width});
        transform: translateX(-50%) translateX(calc($g-sub-sidebar-width / 2));
      }
    }
  }

  &[data-sidebar-collapse] {
    [data-fixed-calc-width] {
      width: calc(100% - #{$g-main-sidebar-width} - 64px);
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(32px);
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(100% - 64px);
        transform: translateX(-50%) translateX(32px);
      }
    }
  }
}

[data-layout="center"] {
  [data-fixed-calc-width] {
    width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
  }

  &[data-sidebar-no-collapse] {
    [data-fixed-calc-width] {
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(calc($g-sub-sidebar-width / 2));
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - #{$g-sub-sidebar-width});
        transform: translateX(-50%) translateX(calc($g-sub-sidebar-width / 2));
      }
    }
  }

  &[data-sidebar-collapse] {
    [data-fixed-calc-width] {
      width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - 64px);
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(32px);
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - 64px);
        transform: translateX(-50%) translateX(32px);
      }
    }
  }
}

[data-layout="center-max-width"] {
  [data-fixed-calc-width] {
    width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
  }

  &[data-sidebar-no-collapse] {
    [data-fixed-calc-width] {
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(calc($g-sub-sidebar-width / 2));
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - #{$g-sub-sidebar-width});
        transform: translateX(-50%) translateX(calc($g-sub-sidebar-width / 2));
      }
    }
  }

  &[data-sidebar-collapse] {
    [data-fixed-calc-width] {
      width: calc(#{$g-app-width} - #{$g-main-sidebar-width} - 64px);
      transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2)) translateX(32px);
    }

    &[data-no-main-sidebar] {
      [data-fixed-calc-width] {
        width: calc(#{$g-app-width} - 64px);
        transform: translateX(-50%) translateX(32px);
      }
    }
  }
}

[data-layout="center"],
[data-layout="center-max-width"] {
  @media screen and (max-width: $g-app-width) {
    [data-fixed-calc-width] {
      width: calc(100% - #{$g-main-sidebar-width} - #{$g-sub-sidebar-width});
    }

    &[data-sidebar-no-collapse] {
      [data-fixed-calc-width] {
        transform: translateX(-50%) translateX(calc($g-main-sidebar-width / 2))
          translateX(calc($g-sub-sidebar-width / 2));
      }

      &[data-no-main-sidebar] {
        [data-fixed-calc-width] {
          width: calc(100% - #{$g-sub-sidebar-width});
          transform: translateX(-50%) translateX(calc($g-sub-sidebar-width / 2));
        }
      }
    }

    &[data-sidebar-collapse] {
      [data-fixed-calc-width] {
        width: calc(100% - #{$g-main-sidebar-width} - 64px);
      }

      &[data-no-main-sidebar] {
        [data-fixed-calc-width] {
          width: calc(100% - 64px);
        }
      }
    }
  }
}

[data-mode="mobile"] {
  [data-fixed-calc-width] {
    width: 100% !important;
    transform: translateX(-50%) !important;
  }
}

// remix icon
[class^="ri-"],
[class*=" ri-"] {
  display: inline-block;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  vertical-align: bottom;
  font-variant: normal;
}
